{/* LAYOUT模板 */}
	<layout name="layout"/>
{/* LAYOUT模板 */}

{/* Import Js,Css */}	
	<js href="__PUBLIC__/Js/listTable.js"/>	
	<css href="__PUBLIC__/Css/admin/common.css"/>
	
	<css href="__PUBLIC__/Css/jquery-ui.css" />
	<js href="__PUBLIC__/Js/jquery-ui.1.10.4.js" />
	<js href="__PUBLIC__/Js/core/plugins.js"/>
{/* Import Js,Css */}

<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->

<div class="mauto">
	<table id="mytab"  border="1" class="t1" width="100%">
		<tr class="a1">
			<th align="center" width="30px;">
				<span>{$Think.lang.selectall}</span>
				<input type="checkbox">
			</th>		
			<th align="left">{$Think.lang.category_name}</th>
			<th align="center">{$Think.lang.sort_order}</th>
			<th align="center">{$Think.lang.invalid}</th>
			<th align="center">{$Think.lang.action}</th>
		</tr>
		<volist name="catList" id="vo">
		<tr id="tr_{$vo.id}" class="value">
			<td align="center">		  	   
				<input type="checkbox" />		  
			</td>
			<td>{$vo.name}</td>
			<td class="ctext">{$vo.sort}</td>
			<td class="ctext">
				<img class="pointer" onclick="listTable.changeStatus(this, 'invalid', {$vo.id});" src="__PUBLIC__/Image/<if condition="$vo.invalid eq 0">bg_yes.gif<else/>bg_no.gif</if>"/>
			</td>
			<td>
				<div class="action">			       		
					<span>   
						<a class="del" href="javascript:void(0);" data="{$vo.id}" title="{$Think.lang.delete}"></a>
						<a class="mod" href="__APP__/Course/mod_category?id={$vo.id}" title="{$Think.lang.modify}"></a>
						<a class="add" href="__APP__/Course/addcategory?id={$vo.id}" title="添加子分类"></a>
					</span>
				</div>
			</td>
		</tr>
		</volist>  	 
	</table>
	<include file="Library:paginator"/>
</div>

<!-- [气泡提示框插件HTML代码] -->
	<include file="Core:QTip"/>
<!-- [气泡提示框插件HTML代码] -->
<div id="loading"class="hide"><!--Qloading:不能删除--></div>

<script>
	// Initialize Url
	listTable.init('__URL__/ajaxCategory');
	/* 气泡提示框 */
	$('a[title]').qtip({ 
		style: { name: 'green'/* black,cream,green,dark,light,red,blue */, tip: true },
		position: { adjust: { screen: true } } /* 根据位置自动调整 */
	});
	// 移除课程到回收站
	$("a.del").click(function(){
		// get Id
		var id = $(this).attr('data');		
		$.ajax({
			url:"__URL__/ajaxCategory",
			data:{'id':id,'action':'del'},
			dataType:'json',
			type:'post',
			beforeSend:function(){
				$('#loading').QLoading({'text':'处理中','status':'open','model':false});
			},
			success:function(msg){				
				if(msg.data == '1'){
					var tr = $("#tr_" + id);
					tr.remove();
					$('#loading').QLoading({'text':msg.info,'status':'close','time':0.5,'img':'happy','model':false});
				}
				else{
					$('#loading').QLoading({'text':msg.info,'status':'close','time':2,'img':'sad','model':false});
				}
			}		
		});
	});
</script>

